#include #include #define CHECK(call)//{// const cudaError_t error = call;// if (error != cudaSuccess)// {// printf("Error: %s:%d, ", __FILE__, __LINE__);// printf("code:%d, reason: %s\n", error, cudaGetErrorString(error));// exit(1);// }//} void checkResult(float *hostRef, float *gpuRef, const int N){ double epsilon = 1.0E-8; bool match = 1; for (int i = 0; i epsilon) { match = 0; printf("Arrays do not match!\n"); printf("host %5.2f gpu %5.2f at current %d\n", hostRef[i], gpuRef[i], i); break; } } if (match) printf("Arrays match.\n\n");} void initialData(float *ip, int size){ // generate different seed for random number time_t t; srand((unsigned int) time(&t)); for (int i = 0; i |